<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/common/taglibs.jsp"%>
<!DOCTYPE html>
<html class="ng-app:myApp" id="ng-app" ng-app="myApp" xmlns:ng="http://angularjs.org">
<head>
<title>分段订单查询</title>
<%@ include file="/WEB-INF/common/meta.jsp"%>
<%@ include file="/WEB-INF/layouts/global_res_header.jsp"%>
</head>

<body ng-controller="legsCtrl">
	<div id="mainDataBlock" ng-grid="gridOptions"></div>
	<div id="funcBlock" class="alert alert-info">
		<div class="btn-group btn-group-sm">
			<button type="button" class="btn btn-default" ng-click="onOpenQueryFormModal()">
				<span class="glyphicon glyphicon-search"></span> 查询
			</button>
			<button type="button" class="btn btn-default" ng-click="refresh()">
				<span class="glyphicon glyphicon-refresh"></span> 刷新
			</button>
			<shiro:hasPermission name="oms:legs:export">
			<button type="button" class="btn btn-default" ng-click="onOpenExportFormModal()">
				<span class="glyphicon glyphicon-export"></span> 导出
			</button>
			</shiro:hasPermission>
		</div>
	</div>
</body>

<div id="queryFormModal" class="modal" tabindex="-1" data-width="500px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">查询</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="queryFormForm" class="form-inline" role="form">
					<div class="form-group" style="margin-left: 58px;">
						<label for="clientId">客户</label>
						<select name="clientId" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.clientId" style="width: 100%" class="select2" data-placeholder="客户">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="client in clientList" value="{{client.id}}">{{client.shortName}}</option>
						</select>
					</div>
					<div class="form-group" style="margin-left: 10px;">
						<label for="orderCd">订单号</label>
						<input name="orderCd" ng-model="queryForm.orderCd" class="form-control" placeholder="订单标识">
					</div>
					<div class="form-group" style="margin-top: 5px;margin-left: 34px;">
						<label for="status">订单状态</label>
						<select name="status" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.status" style="width: 100%" class="select2" data-placeholder="订单状态">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="status in statusList" value="{{status.descr}}">{{status.val}}</option>
						</select>
					</div>
					<div class="form-group" style="margin-top: 5px; margin-left: 22px;">
						<label for="status">状态</label>
						<select name="st" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.st" style="width: 100%" class="select2" data-placeholder="状态">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="st in stList" value="{{st.descr}}">{{st.val}}</option>
						</select>
					</div>
					<div class="form-group" style="margin-top: 5px;">
						<span style="font-size: 18px; color: red">*</span>
						<label for="status">计划到达时间</label>
						<input name="planaDt1" required ng-model="queryForm.planaDt1" placeholder="开单时间" />								
					</div>
					<div class="form-group" style="margin-top: 5px; margin-left: 34px;">
						<label for="status">至</label>
						<input name="planaDt2" required ng-model="queryForm.planaDt2" placeholder="开单时间" />								
					</div>
					<div class="form-group" style="margin-left: 34px;margin-top: 5px">
						<label for="orderCd1">批量单号</label>
						<textarea style="width: 352px;" name="orderCd1" ng-model="queryForm.orderCd1" class="form-control"></textarea>
					</div>
					<div class="form-group" style="margin-top: 5px;margin-left: 34px;">
						<label for="vocation">业务类型</label>
						<select name="vocation" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.vocation" style="width: 100%" class="select2" data-placeholder="订单类型">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="vocation in cdList" value="{{vocation.descr}}">{{vocation.val}}</option>
						</select>
					</div>
					<div class="form-group">
						<label for="shipmentCd">调度单号</label>
						<input style="margin-top: 5px" name="shipmentCd" ng-model="queryForm.shipmentCd" class="form-control" placeholder="订单标识">
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button id="cx" ng-click="onQuery()" ng-disabled="queryFormForm.$invalid" class="btn btn-default">查询</button>
	</div>
</div>

<div id="editFormModal" class="modal" tabindex="-1" data-width="1050" style="display: none; margin-left: 0px;">
	<div class="modal-header" id="or">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title" style="font-weight: bold;">分段订单信息</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editFormForm" role="form" novalidate>
					<input type="hidden" name="id" ng-model="editForm.id" class="form-control">
					<input type="hidden" name="shipment_method" ng-model="editForm.shipment_method" class="form-control">
					<div class="row">
						<div class="col-sm-3">							
							客户： <input name="clientName" ng-model="editForm.clientName" required class="form-control" placeholder="订单号">
						</div>
						<div class="col-sm-3">
							订单号： <input name="orderCd" ng-model="editForm.orderCd" required class="form-control" placeholder="订单号">
						</div>
						<div class="col-sm-3">								
							业务类型： <input name="vocationName" ng-model="editForm.vocationName" required class="form-control" placeholder="订单号">
						</div>
						<div class="col-sm-3">								
							目的地： <input name="ttranslocationName" ng-model="editForm.ttranslocationName" required class="form-control" placeholder="订单号">
						</div>
					</div>
					<div class="row top" >
						<div class="col-sm-3">							
							数量： <input name="quantity" ng-model="editForm.quantity" class="form-control" placeholder="数量">
						</div>
						<div class="col-sm-3">
							&nbsp;&nbsp;&nbsp;&nbsp;重量： <input name="weight" ng-model="editForm.weight" class="form-control" placeholder="重量">
						</div>
						<div class="col-sm-3">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;体积： <input name="volume" ng-model="editForm.volume" class="form-control" placeholder="体积">
						</div>
						<div class="col-sm-3">
							&nbsp;&nbsp;&nbsp;&nbsp;托数： <input name="palletsum" ng-model="editForm.palletsum" class="form-control" placeholder="托数">
						</div>
					</div>		
				</form>
			</div>
		</div>
	</div>
	<div style="width: 1045px;margin-top: 5px">
		<div id="mainData" ng-grid="gridOption" style="width: 100%;"></div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
	</div>
</div>

<div id="confirmFormModal" class="modal" tabindex="-1" data-width="300"style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title"></h4>
	</div>
	<div style="height: 40px;margin-left: 20px;margin-top: 15px;">
	<form name="editFormForm" class="form-horizontal" role="form" novalidate>
		确认时间：<input name="time" style="width: 150px;display: inline;" ng-model="editForm.time" class="form-control" placeholder="派车确认">		
			   <input name="status" style="display: none;" ng-model="editForm.status" class="form-control" placeholder="派车确认">		
	</form>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button type="button" ng-click="Confirm()" class="btn btn-default">确认</button>
	</div>
</div>


<div id="editFormModalPs" class="modal" tabindex="-1" data-width="450"style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">配送异常情况登记</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editFormFormps" class="form-inline" role="form" novalidate>
					<div style="margin-top: 5px">
						<label for="account">配送异常情况：</label>
						<textarea style="width: 300px;" name="account" ng-model="editFormPs.account" class="form-control"></textarea>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button type="button" ng-click="ps()" class="btn btn-default">确认</button>
	</div>
</div>

<div id="editFormModalRe" class="modal" tabindex="-1" data-width="300"style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">退货确认</h4>
	</div>
	<div style="height: 40px;margin-left: 20px;margin-top: 15px;">
		<form name="editFormFormR" class="form-horizontal" role="form" novalidate>
		退货确认：<input name="rtime" style="width: 150px;display: inline;" ng-model="editFormR.rtime" class="form-control" placeholder="退货确认">		
		</form>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button type="button" ng-click="rConfirm()" class="btn btn-default">确认</button>
	</div>
</div>

<div id="editFormModalCd" class="modal" tabindex="-1" data-width="800px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">拆单</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editFormFormCd" class="form-horizontal" role="form" novalidate>
					<div class="form-group hidden">
						<label for="id" class="col-sm-4 control-label">ID</label> 
						<div class="col-sm-5">
							<input type="hidden" name="id" ng-model="editForm.id" class="form-control">		
						</div>
					</div>
					<div class="row">
						<div class="col-sm-4">							
							订单编号： <input style="width: 150px" name="orderCd" ng-model="editFormCd.orderCd" required class="form-control" placeholder="订单编号" ng-disabled="orderCd">		
						</div>
						<div class="col-sm-4">							
							客户名称： <select name="clientId" ui-select2="{width:'150px', allowClear:'true'}" ng-model="editFormCd.clientId" style="width: 100%" class="select2" data-placeholder="客户" ng-disabled="clientCd">
								<option ng-repeat="client in clientList" value="{{client.id}}">{{client.shortName}}</option>
							</select>						
						</div>
						<div class="col-sm-4">							
							件数： <input style="width: 150px;" name="quantity" ng-model="editFormCd.quantity" class="form-control" placeholder="件数">
						</div>
					</div>
					<div class="row">
						<div class="col-sm-4">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重量： <input style="width: 150px;margin-top: 5px" name="weight" ng-model="editFormCd.weight" class="form-control" placeholder="重量" step=0.000001>		
						</div>
						<div class="col-sm-4">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 体积： <input style="width: 150px;margin-top: 5px" name="volume" ng-model="editFormCd.volume" class="form-control" placeholder="体积" step=0.000001>		
						</div>
						<div class="col-sm-4">							
							托数： <input style="width: 150px;margin-top: 5px" name="palletsum" ng-model="editFormCd.palletsum" class="form-control" placeholder="托数">		
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="takePart()" ng-disabled="editFormFormCd.$invalid" class="btn btn-default">提交</button>
	</div>
</div>

<div id="editFormModalBc" class="modal" tabindex="-1" data-width="300" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">波次</h4>
	</div>
		<div style="height: 40px;text-align: center;">
			<form name="editFormFormbc" class="form-inline" role="form">	
					<div class="form-group" style="margin-top: 5px">
						<label for="waveId">波次名称</label>
						<select name="waveId" ui-select2="{width:'150px', allowClear:'true'}" ng-model="editFormBc.waveId" style="width: 100%" class="select2" data-placeholder="客户" ng-disabled="bcCd">
								<option value=""></option>
								<option value=""></option>
								<option ng-repeat="wave in waveList" value="{{wave.id}}">{{wave.name}}</option>
						</select>					
					</div>			
			</form>			
		</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="zdbcpz()" ng-disabled="editFormFormbc.$invalid" class="btn btn-default">提交</button>
	</div>
</div>

<div id="importFormModal" class="modal" tabindex="-1" data-width="400px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">导入</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="importFormForm" action="{{importForm.importUrl}}" target="_blank" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
					<div class="form-group">
						<div class="col-sm-8">
						<input name="importUrl" id="importUrl" ng-required="true" ng-model="importForm.importUrl" class="form-control" placeholder="导入" style="display: none;">
						</div>
					</div>
					<div class="form-group">
						<label for="file" class="col-sm-3 control-label">文件</label>
						<div style="float: left;margin-right: 10px;">
							<input type="file" name="file" class="form-control">
						</div>
						<div style="float: left;">
							<button ng-click="onExportTemplate()" type="button" class="btn btn-success" style="height: 30px;padding: 4px 6px;">下载模板</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button type="button" ng-disabled="importFormForm.$invalid" ng-click="onImport()" class="btn btn-primary">导入</button>
	</div>
</div>
<div class="contextMenu" id="menu">
	<ul>
		<li id="find" ng-click="onOpenQueryFormModal()">
		 <img src=""/> 
		&nbsp;查询&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		<li id="refresh" ng-click="refresh()">
		 <img src=""/> 
		&nbsp;刷新&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		<shiro:hasPermission name="oms:legs:del">
		<li id="del" ng-click="del()">
		 <img src=""/> 
		&nbsp;删除拆单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:find">
		<li id="upd" ng-click="onOpenEditFormModal('upd')">
		 <img src=""/> 
		&nbsp;查看分段订单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:confirm">
		<li id="confirm" ng-click="onOpenConfirmFormModal('pc')">
		 <img src=""/> 
		&nbsp;派车确认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:in">
		<li id="in" ng-click="onOpenConfirmFormModal('rk')">
		 <img src=""/> 
		&nbsp;车辆入库&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:out">
		<li id="out" ng-click="onOpenConfirmFormModal('ck')">
		 <img src=""/> 
		&nbsp;车辆出库&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:send">
		<li id="send" ng-click="onOpenConfirmFormModal('fy')">
		 <img src=""/> 
		&nbsp;发运确认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:arrive">
		<li id="arrive" ng-click="onOpenConfirmFormModal('yd')">
		 <img src=""/> 
		&nbsp;运抵确认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:ps">
		<li id="ps" ng-click="onOpenEditFormModalPs()">
		 <img src=""/> 
		&nbsp;配送异常情况登记&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:return">
		<li id="return" ng-click="onOpenEditFormModalRe()">
		 <img src=""/> 
		&nbsp;退货确认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:excrete">
		<li id="excrete" ng-click="onOpenEditFormModalCd()">
		 <img src=""/> 
		&nbsp;拆单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:specify">
		<li id="specify" ng-click="zdbc()">
		 <img src=""/> 
		&nbsp;指定波次&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:legs:refresh">
		<li id="refresh1" ng-click="import()">
		 <img src=""/> 
		&nbsp;更新波次&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
	</ul>
</div>
<%@ include file="/WEB-INF/layouts/global_res_footer.jsp"%>
<script type="text/javascript" src="${ctx}/res_oms/oms/legs.js"></script>
<script type="text/javascript" src="${ctx}/res_oms/jquery.contextmenu.r2.js"></script> 
</html>
